#! /bin/bash
var=$(ps -ef|grep nginx|grep -v grep | wc -l)

if [ ${var} -eq 0 ];then 
    systemctl restart nginx
fi